﻿using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using Newtonsoft.Json.Linq;
using System.ComponentModel;

namespace Kingdee.SR.Plugin
{
    [Description("【单据插件】测试写入辅助属性"), HotUpdate]
    public class AuxTestPlugIn : AbstractBillPlugIn
    {
        public override void ButtonClick(ButtonClickEventArgs e)
        {
            base.ButtonClick(e);
            if (e.Key.EqualsIgnoreCase("F_AST_Button"))
            {
                var id = this.View.Model.GetPKValue() + "";
                var obj = new JObject();
                obj["Id"] = id;

                this.View.Model.CreateNewEntryRow("FEntity");
                
                this.Model.SetValue("FMaterialId", 150867, 1);
                this.Model.SetValue("FReqQty", 123, 1);
                this.Model.SetValue("FAmount", 321, 1);
                this.Model.SetValue("FAuxpropId", 100002, 1);
                this.Model.SetValue("FREQSTOCKUNITID", 10101, 1);
                this.Model.SetValue("FPriceUnitId", 10101, 1);
                this.Model.SetValue("FUnitId", 10101, 1);
                  


            }
        }
    }
}
